<template>
	<view class="concent">
		<view class="orders">
			<view class="orders-item" v-for="(item, index ) in ordersList" :key="item.id">
				<uni-card class="card">
					<view class="info">
						<view class="left">
							<view class="avatar">
								<u--image :src="item.shopAvatar" shape="circle" width="100rpx"
									height="100rpx"></u--image>
							</view>
							<view class="more">
								<view class="name">
									{{item.shopName}}
								</view>
								<view class="time">
									{{item.ordersTime}}
								</view>
							</view>
						</view>
						<view class="right">
							<view class="orderStatus"
								:class="item.orderStatus == '交易成功' ? 'green':item.orderStatus=='交易中'?'yellow':''">
								{{item.orderStatus}}
							</view>
							<view class="orderPrice">
								￥{{item.orderPrice}}
							</view>
						</view>
					</view>
					<view class="btn">
						<view class="complain_btn" @click="goReasonComplain(item.id)">
							<u-button size="mini" type="primary" shape="circle" text="申请投诉"></u-button>
						</view>
					</view>
				</uni-card>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ordersList: [{
					// 订单id
					id: '11552336',
					// 商家名称
					shopName: '小黄约拍',
					// 交易状态
					orderStatus: '交易成功',
					// 交易时间
					ordersTime: '2023年7月7日',
					// 商家头像
					shopAvatar: 'https://cdn.uviewui.com/uview/album/1.jpg',
					// 订单价格
					orderPrice: '888.00',

				}, {
					// 订单id
					id: '11552336',
					// 商家名称
					shopName: '小黄约拍',
					// 交易状态
					orderStatus: '交易中',
					// 交易时间
					ordersTime: '2023年7月7日',
					// 商家头像
					shopAvatar: 'https://cdn.uviewui.com/uview/album/1.jpg',
					// 订单价格
					orderPrice: '888.00',

				}, {
					// 订单id
					id: '11552336',
					// 商家名称
					shopName: '小黄约拍',
					// 交易状态
					orderStatus: '交易取消',
					// 交易时间
					ordersTime: '2023年7月7日',
					// 商家头像
					shopAvatar: 'https://cdn.uviewui.com/uview/album/1.jpg',
					// 订单价格
					orderPrice: '888.00',

				}]
			};
		},
		methods: {
			goReasonComplain(id) {
				uni.navigateTo({
					url: `/subPackages_tousu/ReasonComplain/ReasonComplain?id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.concent {
		padding: 0;
		margin: 0;
		box-sizing: border-box;

		.card {

			.info {
				padding: 15rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 30rpx;
				border-bottom: 1px solid #f8f8f8;

				.left {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.avatar {
						margin-right: 20rpx;
					}

					.more {
						.name {
							font-size: $uni-font-size-lg;
							font-weight: 900;
							margin-bottom: 10rpx;
						}
					}
				}

				.right {
					.orderStatus {
						margin-bottom: 10rpx;
					}
				}
			}

			.btn {
				display: flex;
				justify-content: flex-end;
				align-items: center;

				.complain_btn {

					width: 150rpx;
					height: 70rpx;
				}
			}

		}

		.green {
			color: green;
		}

		.yellow {
			color: #ffaa00;
		}


	}
</style>